package com.ruoyi.information.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.information.mapper.InventoryCustomerMapper;
import com.ruoyi.information.domain.InventoryCustomer;
import com.ruoyi.information.service.IInventoryCustomerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class InventoryCustomerServiceImpl implements IInventoryCustomerService 
{
    @Autowired
    private InventoryCustomerMapper inventoryCustomerMapper;

    /**
     * 查询客户信息
     * 
     * @param customerId 客户信息主键
     * @return 客户信息
     */
    @Override
    public InventoryCustomer selectInventoryCustomerByCustomerId(String customerId)
    {
        return inventoryCustomerMapper.selectInventoryCustomerByCustomerId(customerId);
    }

    /**
     * 查询客户信息列表
     * 
     * @param inventoryCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public List<InventoryCustomer> selectInventoryCustomerList(InventoryCustomer inventoryCustomer)
    {
        return inventoryCustomerMapper.selectInventoryCustomerList(inventoryCustomer);
    }

    /**
     * 新增客户信息
     * 
     * @param inventoryCustomer 客户信息
     * @return 结果
     */
    @Override
    public int insertInventoryCustomer(InventoryCustomer inventoryCustomer)
    {
        inventoryCustomer.setCreateTime(DateUtils.getNowDate());
        return inventoryCustomerMapper.insertInventoryCustomer(inventoryCustomer);
    }

    /**
     * 修改客户信息
     * 
     * @param inventoryCustomer 客户信息
     * @return 结果
     */
    @Override
    public int updateInventoryCustomer(InventoryCustomer inventoryCustomer)
    {
        inventoryCustomer.setUpdateTime(DateUtils.getNowDate());
        return inventoryCustomerMapper.updateInventoryCustomer(inventoryCustomer);
    }

    /**
     * 批量删除客户信息
     * 
     * @param customerIds 需要删除的客户信息主键
     * @return 结果
     */
    @Override
    public int deleteInventoryCustomerByCustomerIds(String customerIds)
    {
        return inventoryCustomerMapper.deleteInventoryCustomerByCustomerIds(Convert.toStrArray(customerIds));
    }

    /**
     * 删除客户信息信息
     * 
     * @param customerId 客户信息主键
     * @return 结果
     */
    @Override
    public int deleteInventoryCustomerByCustomerId(String customerId)
    {
        return inventoryCustomerMapper.deleteInventoryCustomerByCustomerId(customerId);
    }
}
